﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using MySql.Data.MySqlClient;


namespace Pc_Vision.DAOFactorys
{
    public class DAOcategorie : DbConnection
    {
        public void InsertCategorie(Model.Categorie c)
        {
            string query = "INSERT INTO categorie(Categorienaam, Omschrijving) VALUES ('" + c.categorieName + "' ,'" + c.categorieDescription + "' )";
            InsertDB(query);
        }

        //public List<Model.Categorie>[] GetAllCatgories()
        public ArrayList GetAllCategories()
        {
            string query = "SELECT * FROM categorie";
            ArrayList arr = GetAllCategories(query);
            return arr;
        }

        public void UpdateCategorie(Model.Categorie c)
        {
            
            string query = "UPDATE categorie SET Categorienaam = '" + c.categorieName + "', Omschrijving = '" + c.categorieDescription + "' WHERE Categorieid = '" + c.id + "'";
            UpdateDB(query);

        }

        public void DeleteCategorie(Model.Categorie c)
        {
            string query = "DELETE from categorie WHERE Categorieid='" + c.id+ "'";
            DeleteDB(query);
        }



    }
}